<template>
  <div style="height:100%;">
      <commonLayout :deviceSystem="2" @getData="getData" :spaceType="spaceType">
          <template slot="search">
              <div>
                  <tips></tips>
              </div>
          </template>
          <template slot="btn">
              <div>
                 <el-button size="mini" class="btn" @click="flag = 1,spaceType = 2">门禁设备</el-button>
                 <el-button size="mini" class="btn" @click="flag = 2,spaceType = 2">进出记录</el-button>
              </div>
          </template>
          <template v-if="spaceType == 2" slot="sectionFilter">
            <keep-alive>
                    <select1  v-if="flag == 2"></select1>
                    <select2  v-if="flag == 1"></select2>
            </keep-alive>
        </template>

          <template slot="data">
              <keep-alive>
                  <div>
                      <doorDevInfo v-if="flag == 1"></doorDevInfo>
                      <doorLog v-if="flag == 2"></doorLog>
                  </div>
              </keep-alive>
          </template>
      </commonLayout>
  </div>
</template>

<script>
 import commonLayout from '../../components/common_layout.vue'
 import doorDevInfo from './acs_dev.vue'
 import select1 from './select1.vue'
 import select2 from './select2.vue'
 import tips from '../../components/legend_tips.vue'
 import doorLog from './acs_auth_inout_log.vue'
export default {
    data() {
        return {
            flag:1,
            spaceType:1
        }
    },
      components:{
        select1,select2,
        commonLayout,doorDevInfo,tips,doorLog
    },
    methods:{
        getData(val){
            this.spaceType = val.spaceType
        }
    }
}
</script>

<style scoped>
</style>